#ifndef DECODERCLIENTTHREAD_H
#define DECODERCLIENTTHREAD_H

#include <iostream>
#include <pthread.h>
#include "MRSink.h"

#ifdef USE_DECODERS

	#include <libavcodec/avcodec.h>
	#include <libavformat/avformat.h>

	#include <stdio.h>
	#include <stdlib.h>
	#include <string.h>
	#include <unistd.h>
	#include <getopt.h>
	#include <strings.h>
	#include <sysexits.h>
	#include <sys/time.h>
	#include <sys/resource.h>
	//#include <xdc/std.h>
	#include <glib.h>

	#include "demo.h"
	#include "audio.h"

#endif


using namespace std;

class DecoderClient;

struct ThreadArgStruct2
{
	DecoderClient* decoder;
	MRSink* sink;
};


class DecoderClient
{
public:
	DecoderClient(MediaSink* ptrSink);
	~DecoderClient();

	void decoderClientThreadCoreFuncInClass();

	int configureThread();
	int launchThread();
	int joinThread();

private:
	pthread_t threadID;
	pthread_attr_t threadAttr;
	struct sched_param threadSchedParam;

	MRSink* sink;
	ThreadArgStruct2 tas;
};

void* decoderClientCoreFunc(void* ptr);

#endif
